<?php
class readPlan extends plan {
	function __construct($id) {
		parent::__construct($id);
	}

	public function getAllFrom($id) {
		$arrResult = array();
		$query = "SELECT * FROM planes";
		$query .= " WHERE (id=".$id.") AND (estado>0) AND (fk_profesor = ".$this->get('planes','fk_profesor').");";
		$result = mysql_query($query) or die(mysql_error());
		$i = 0;
		while ($reg = @mysql_fetch_array($result)) {
			$i++;
			$this->set('planes','nombre',$reg['nombre']);
			$this->set('planes','descripcion',$reg['descripcion']);
			$this->set('planes','estado',$reg['estado']);
		}
		return $i;
	}
}
?>